package com.wangijun.yuan.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wangijun.yuan.core.domain.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    @Update("update user_info" +
            " set read_num = read_num + #{num}" +
            " where id = #{id}")
    void readNumAdd(@Param("id") Long id, @Param("num") Integer num);


    @Update("update user_info" +
            " set art_count = art_count + #{num}" +
            " where id = #{id}")
    void artCountAdd(@Param("id") Long id, @Param("num") Integer num);

    /**
     * 功能描述: 粉丝数变动
     *
     * @author wlf 2024/6/29 10:30
     */
    int fansNumAdd(@Param("userId")Long userId, @Param("num")Integer num );

    /**
     * 功能描述: 关注数变动
     *
     * @author wlf 2024/6/29 10:30
     */
    int favNumAdd(@Param("userId")Long userId, @Param("num")Integer num );
}